package com.ruoyi.fjtseac.domain.dto;

import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author zzl
 * @since 2022-07-06
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="Volunteer对象", description="")
public class VolunteerDto implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "志愿者编号")
    private Long volunteerId;

    @Excel(name = "姓名")
    @Pattern(regexp = "[\\u4E00-\\u9FA5]{1,80}",message = "名字必须为汉字，且不存在空格")//汉字匹配一次以上
    @ApiModelProperty(value = "姓名")
    private String name;

    @Excel(name = "性别")
    @Pattern(regexp = "[男]|[女]",message = "输入的性别（男/女）")
    @ApiModelProperty(value = "性别")
    private String gender;

    /*根据该博客手机号码规则进行手机号码验证
    https://blog.csdn.net/itbrand/article/details/109239620?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522165891548316781432967439%2522%252C%2522scm%2522%253A%252220140713.130102334.
    .%2522%257D&request_id=165891548316781432967439&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~top_positive~default-1-109239620-null-null.142^v35^down_rank,
    185^v2^control&utm_term=%E7%94%B5%E8%AF%9D%E5%8F%B7%E7%A0%81%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F&spm=1018.2226.3001.4187
     */
    @Excel(name = "手机号码")
    @Pattern(regexp = "^134[0-8]\\d{7}$|^13[^4]\\d{8}$|^14[^2,3]\\d{8}$|^15[^4]\\d{8}$|^16[2,5,6,7]\\d{8}$|^17[0-8]\\d{8}$|^18[\\d]{9}$|^19[^4]\\d{8}$", message = "请输入正确号码")
    @ApiModelProperty(value = "手机号码")
    private String phone;

    @ApiModelProperty(value = "加入日期")
    private Date joinTime;

    @ApiModelProperty(value = "创建者")
    private String createBy;

}
